<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_mailto
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;
// import Joomla view library
jimport('joomla.application.component.view');

class GlycophileViewNominatifs extends JViewLegacy
{
	function display($tpl = null)
	{

    $designation = JRequest::getVar('designation', "");
    $id_s = JRequest::getVar('id_s', "");
    if($designation == ""){
    $nominatif = JRequest::getVar('nominatif', "");

		$series	= $this->get('data');
    $total	= $this->get('total');
    $pagination = $this->get('pagination');

		$this->assignRef('series', $series);
		$this->assignRef('total', $total);
    $this->assignRef('nominatif', $nominatif);
    if($nominatif != '')
    $this->assignRef('pagination', $pagination);
    } else {
      $tpl = "sucres";
      $helper = new GlycophileHelper();
      $series	= $helper->getSucresByNominatif($designation);
      $this->assignRef('series', $series);
      $this->assignRef('designation', $designation);
      
    }
   
		
		parent::display($tpl);
	}
}
